<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="../lib/html5.js"></script>
<script type="text/javascript" src="../lib/respond.min.js"></script>
<script type="text/javascript" src="../lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
    <link href="../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
<script type="text/javascript" src="../lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>仓库</title>
</head>
<body>
    <div class="pd-20">
        <form id="itemEdit" name="itemEdit" method="post" action="../ashx/spui.ashx" class="form form-horizontal">
            <input type="hidden" class="actionValue" id="editAction" name="action" value="add" />
            <input type="hidden" id="id" name="id" />
            <input type="hidden" id="fgid" name="fgid" value="" />
            <input type="hidden" id="tablename" name="tablename" value="" />
            <input type="hidden" id="tablemidname" name="tablemidname" value="" />
            <input type="hidden" id="dataneedtouser" name="dataneedtouser" value="1" /><!--是否要包含通用数据必归属处理-->
            <input type="hidden" id="ywcheckonly" name="ywcheckonly" value="fproducttype,fname,fdatabranchid#当前物品编号已存在!" />
            <div class="row cl">
                <label class="form-label col-1">作业：</label>
                <div class="formControls col-2">
                    <span class="select-box">
                        <select class="select" size="1" name="fworktypeid" id="fworktypeid" datatype="*1-50">
                        </select></span>
                    <input type="hidden" name="fworktypename" id="fworktypename" />
                </div>
                <div class="col-5">指定投入品可用于的作业，通用请选择-其它</div>
            </div>
            <div class="row cl">
                <label class="form-label col-1"><span class="c-red">*</span>主分类：</label>
                <div class="formControls col-2">
                    <span class="select-box">
                        <select class="select" size="1" name="fproducttype" id="fproducttype" datatype="*1-50"></select>
                    </span>
                </div>
                <div class="col-1"></div>
                <!--  <label class="form-label col-1"><span class="c-red">*</span>子分类：</label>
                <div class="formControls col-2">
                    <span class="select-box">
                        <select class="select" size="1" name="fproductclass" id="fproductclass" datatype="*1-50"></select>
                    </span>
                </div>-->
                <label class="form-label col-1"><span class="c-red">*</span>编号：</label>
                <div class="formControls col-2">
                    <input type="text" class="input-text" name="fproductno" id="fproductno" nullmsg="不能为空" datatype="*1-50" placeholder="2~50个字符" />
                    <input type="hidden" class="input-text" name="fname" id="fname" />
                </div>
            <!--    <div class="col-1"></div>
                <label class="form-label col-1"><span class="c-red">*</span>名称：</label>
                <div class="formControls col-2">
                    <input type="text" class="input-text" name="fname" id="fname" />
                </div>-->
                <div class="col-1"></div>
            </div>
            <div class="row cl">

                <!--  <label class="form-label col-1"><span class="c-red">*</span>规格：</label>
                <div class="formControls col-2">
                    <span class="select-box">
                        <select class="select" size="1" name="fspec" id="fspec"></select>
                    </span>
                </div>-->
                <!--<div class="col-1"></div>-->
                <label class="form-label col-1"><span class="c-red">*</span>预警数量：</label>
                <div class="formControls col-2">
                    <input type="text" class="input-text" name="fwarningcount" id="fwarningcount" value="100" datatype="/^-?[1-9]+(\.\d+)?$|^-?0(\.\d+)?$|^-?[1-9]+[0-9]*(\.\d+)?$/" />
                </div>
                <div class="col-1"></div>


                <label class="form-label col-1"><span class="c-red">*</span>单位：</label>
                <div class="formControls col-2">
                    <span class="select-box">
                        <select class="select" size="1" name="funit" id="funit"></select>
                    </span>
                </div>
                <div class="col-1"></div>
            </div>
            <div class="row cl">
                <label class="form-label col-1">说明：</label>
                <div class="formControls col-7">
                    <input type="text" class="input-text" name="fremark" id="fremark" placeholder="" />
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-1">稀释倍数：</label>
                <div class="formControls col-2">
                    <input type="text" class="input-text" name="fssbs" id="fssbs" value="1" placeholder="稀释倍数" />
                </div>
                  <label class="form-label col-1">亩用量：</label>
                <div class="formControls col-2">
                    <input type="text" class="input-text" name="fdhmjcount" id="fdhmjcount" value="0" placeholder="单位亩用量" />
                </div>
            </div>
            <div class="row cl">
                <!--植保特殊数据-->
                <label class="form-label col-1">防治对象：</label>
                <div id="divinfofv10">
                </div>
            </div>
            特殊要求：如果投入品为种子，那么它的名称 应该包含 品种的名称，例如 一个品种为 有机菜心  那么它的 种子名称应该为 **有机菜心**。（**任何内容。）
            <div class="row cl">
                <div class="col-6 col-offset-4">
                    <button class="btn btn-primary radius" type="submit" id="btsub1">提交</button>&nbsp;&nbsp;
				<button class="btn btn-secondary radius" type="button" id="btn_reset">重置</button>&nbsp;&nbsp;
				<button onclick="layer_close();" class="btn btn-default radius" type="button">返回</button>
                </div>
            </div>
        </form>
    </div>
    <script src="../hcjsui/Scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../lib/icheck/jquery.icheck.min.js"></script>
    <script type="text/javascript" src="../lib/Validform/5.3.2/Validform.js"></script>
    <script type="text/javascript" src="../lib/layer/1.9.3/layer.js"></script>
    <script src="../hcjsui/js/_Define.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/hcui.js"></script>
    <script type="text/javascript" src="../js/hcui_au.js"></script>
    <script type="text/javascript" src="../lib/My97DatePicker/WdatePicker.js"></script>
    <!--以下为多选择下拉ggggggggggggg-->
    <link rel="stylesheet" href="../homepage/css/bootstrap.min.css" type="text/css" />
    <script type="text/javascript" src="../homepage/js/bootstrap.min.js"></script>

    <script type="text/javascript" src="../homepage/js/bootstrap-multiselect.js"></script>
    <link rel="stylesheet" href="../homepage/css/bootstrap-multiselect.css" type="text/css" />
    <script type="text/javascript">
        //HcUiAuloadInfoAuto = false;//将自动加载，设置为false（禁用自动加载）
        hcui_ajaxasync = false;//禁用异步，先加载下拉信息
      
     
        //$('#fproducttype').change(function () {
        //    var type = $(this).children('option:selected').val();
        //    hcdosel("dictdata_code as id,dictdata_name as name", "dictionarydata", "dict_code='ErpProductStype' and parent_code='" + type + "' ", "", "", "orderindex",
        //        function (data) {
        //            SetSelectWithObjIdName("#fproductclass", data);
        //            ("#ffnextid").val(selevalue);
        //        });

        //});


        //加载处理
        function loadin() {
            if (getUrlParam("action") == "add") {
                $("#fgid").val(NewGuid());

            }
            //本页面 
            spsetBase("herp_product", "id", "herp_product as T", "*", "#tablelist", "ProductManage", "物品", "ProductManage");
            //物品分类
            hcdoselbyPost("dictdata_code as id,dictdata_name as name", "dictionarydata", "dict_code='ErpProductMtype'", "", "", "orderindex",
                function (data) {
                    SetSelectWithArrayIdName("#fproducttype", data);
                    //loadisOk++;
                    //if (loadisOk >= needloaddown && auhcotype == "edit") {
                    //    hcui_ajaxasync = true;//恢复异步
                    //    loadInfoById(aumid, function (data) {
                    //        loadback(data);
                    //    });
                    //}
                });
            hcdoselbyPost("fv3 as id,fv1 as name", "yw_baseinfo", "type='4' and  maintype='4'", "", "", "id",
                  function (data) {
                      SetSelectWithArrayIdName("#fworktypeid", data);
                      //loadisOk++;
                      //if (loadisOk >= needloaddown && auhcotype == "edit") {
                      //    hcui_ajaxasync = true;//恢复异步
                      //    loadInfoById(aumid, function (data) {
                      //        loadback(data);
                      //    });
                      //}

                  });
            
            hcdoselbyPost("t1.id  as id,t1.fv1 as name", "yw_baseinfo as t1", "t1.type=9 and t1.maintype=9 and t1.databranchid=" + HCUser.HCUorg, "", "", "id", function (data) {
                SetCheckBoxsInfo("#divinfofv10", "fcanoutobj", data);
            });
            

            ////规格
            //hcdosel("dictdata_code as id,dictdata_name as name", "dictionarydata", "dict_code='ErpProductSpec'", "", "", "orderindex",
            //    function (data) {
            //        SetSelectWithObjIdName("#fspec", data);
            //        loadisOk++;
            //        if (loadisOk >= needloaddown && auhcotype == "edit") {
            //            loadInfoById(aumid, function (data) {
            //                loadback(data);
            //            });
            //        }
            //    });
            //单位
            hcdoselbyPost("dictdata_code as id,dictdata_name as name", "dictionarydata", "dict_code='ErpProductUnit'", "", "", "orderindex",
                function (data) {
                    SetSelectWithArrayIdName("#funit", data);
                    //loadisOk++;
                    //if (loadisOk >= needloaddown && auhcotype == "edit") {
                    //    hcui_ajaxasync = true;//恢复异步
                    //    loadInfoById(aumid, function (data) {
                    //        loadback(data);
                    //    });
                    //}
                });
            ////连动 联动 加载子分类
            //$('#fproducttype').change(function () {
            //    loadProductclass($(this).children('option:selected').val());
            //});


        }
        ////加载子分类
        //function loadProductclass(type, selid) {
        //    if (type == "") return;
        //    hcdosel("dictdata_code as id,dictdata_name as name", "dictionarydata", "dict_code='ErpProductStype' and parent_code='" + type + "' ", "", "", "orderindex",
        //        function (data) {
        //            SetSelectWithObjIdName("#fproductclass", data);
        //            if (selid) $("#fproductclass").val(selid);
        //        });
        //}

        function loadback(data) {
            // Mhcloadback[0] = "ffv3";//设置要回调的内容  如果数据不是下拉的 要这样设置
            //加载 并选择 子分类
            //loadProductclass(data["producttype"], data["productclass"]);
        }
        //重写  提交前数据处理
        function hcrBeforeSub() {
            $("#fworktypename").val($('#fworktypeid option:selected').text());
            $("#fname").val($('#fproductno').val());
        }

    </script>
</body>
</html>
